<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html>
<html>
<head>
<%
	String path = request.getContextPath();
	// 获得本项目的地址(例如: http://localhost:8080/MyApp/)赋值给basePath变量 
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	// 将 "项目路径basePath" 放入pageContext中，待以后用EL表达式读出。 
	pageContext.setAttribute("basePath", basePath);
	//out.write(basePath);
%>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="<%=basePath%>logined/Add/Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="<%=basePath%>logined/Add/Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="<%=basePath%>logined/Add/Css/style.css" />
    <script type="text/javascript" src="<%=basePath%>logined/Add/Js/jquery.js"></script>
    <script type="text/javascript" src="<%=basePath%>logined/Add/Js/bootstrap.js"></script>
    <script type="text/javascript" src="<%=basePath%>logined/Add/Js/ckform.js"></script>
    <script type="text/javascript" src="<%=basePath%>logined/Add/Js/common.js"></script>
        <script>
    $(function () {
        

		$('#addnew').click(function(){

				window.location.href="<%=basePath%>logined/add.jsp";
		 });
		$('#select').click(function(){

			window.location.href="#";
	 });


    });

	function del(id)
	{
		
		if(confirm("确定要删除吗？"))
		{
		
			var url = "index.jsp";
			
			window.location.href=url;		
		
		}
	
	}
</script>
    <script>
    function gettime(){
    	var d = new Date();
    	document.getElementById("time").innerHTML =d.getFullYear() + "年" + (d.getMonth()+1) + "月" + d.getDate()+ "日";;
    	window.setTimeout("gettime()",1000);
    	}
    	window.onload = gettime;
    </script>
 

    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
</head>
<body>
<form class="form-inline definewidth m20">    
  
    &nbsp;  
   
    <button type="button" class="btn btn-success" id="addnew">新增用户</button>
</form>
 <div>
<table class="table table-bordered table-hover definewidth m10">
    <thead>
    <tr>
        <th>序号</th>
        <th>用户名</th>
        <th>性别</th>
        <th>年龄</th>
        <th>联系方式</th>
        <th>地址</th>
        <th>操作</th>
    </tr>
    </thead>
   <tbody>
      <c:forEach items="${sessionScope.lstUser }" var="eachUser" varStatus="st">
	     <tr>
            <td>${st.index+1 }</td>
            <td>${eachUser.username }</td>
            <td>${eachUser.user_sex }</td>
            <td>${eachUser.user_age }</td>
            <td>${eachUser.user_phone }</td>
            <td>${eachUser.user_address }</td>
            <td>
                <a href="<%=basePath%>UserInfoModifyServlet?uid=${eachUser.user_id }&opt=0">编辑</a>   
                <a href="<%=basePath%>UserInfoModifyServlet?uid=${eachUser.user_id }&opt=1" onclick="return confirm('你确认删除吗?');">删除</a>             
            </td>
        </tr>
      </c:forEach>
   </tbody>	
</table>
</div> 
</body>
</html>
